//color
@white: #ffffff;
@black: #000000;
@color85: rgba(0, 0, 0, 0.85);
@color65: rgba(0, 0, 0, 0.65);
@color45: rgba(0, 0, 0, 0.45);
@color25: rgba(0, 0, 0, 0.25);
@font-yellow: #e8b900;
@font-bule: #2cbde9;
@font-red: #f2637b;

// font size
@font-size12: 12px;
@font-size14: 14px;
@font-size16: 16px;
@font-size18: 18px;
@font-size20: 20px;

//gap
@gap5: 5px;
@gap8: 8px;
@gap10: 10px;
@gap16: 16px;
@gap20: 20px;
@gap24: 24px;

//shadow class
@shadow: 0px 0px 3px;
@shadow-color: rgba(0, 0, 0, 5%);
.box-shadow(@style: @shadow, @color: @shadow-color) {
  box-shadow: @style @color;
}

//radius class
@radius: 5px;
.box-radius(@style: @radius) {
  border-radius: @style;
}

//hight class
@minus: 180px;
.calc-height(@minus: @minus) {
  min-height: calc(100vh - @minus);
}
.error {
  color: @error-color;
}

html,
body,
#root {
  height: 100%;
}
ol,
ul {
  margin: 0;
  padding: 0;
}

// public class
.scrollbar {
  overflow-y: auto;
  &::-webkit-scrollbar {
    width: 1px;
    background-color: #f4f4f4;
  }
  &::-webkit-scrollbar-thumb {
    width: 10px;
    background-color: #ddd;
    border-radius: 10px;
  }
}
.orange {
  color: orange;
}

body {
  margin: 0;
  input,
  input:focus {
    background: @white;
  }
  .ant-tag {
    padding: 1px 6px;
    background: #f4f4f4;
    border: none;
    margin-bottom: 5px;
  }
  .ant-btn {
    padding: 0 10px;
    .anticon {
      vertical-align: middle;
    }
  }
  .ant-btn-lg {
    min-width: 80px;
  }
  .ant-table-thead,
  .ant-table-tbody {
    tr > th,
    tr > td {
      border: none;
      border-bottom: none;
    }
  }
  .ant-table-tbody {
    color: @color65;
  }
  .ant-table-row .edit {
    visibility: hidden;
    color: skyblue;
  }
  .ant-table-row:hover .edit {
    visibility: visible;
  }
  /* carousel arrow */
  .ant-carousel .slick-prev,
  .ant-carousel .slick-next,
  .ant-carousel .slick-prev:hover,
  .ant-carousel .slick-next:hover,
  .ant-carousel .slick-prev:focus,
  .ant-carousel .slick-next:focus {
    font-size: inherit;
    color: currentColor !important;
  }
  .ant-carousel .slick-prev::before {
    color: currentColor !important;
  }
  .slick-arrow.slick-prev {
    font-size: 20px !important;
  }
  .ant-carousel .slick-next::before {
    color: currentColor !important;
  }
  .slick-arrow.slick-next {
    font-size: 20px !important;
  }
  .ant-carousel .slick-dots-bottom {
    bottom: -12px;
  }
  .ant-carousel .slick-dots li {
    background-color: @black;
  }
  .ant-carousel .slick-dots li.slick-active button {
    background-color: #ccc;
  }
  .ant-tag-error {
    color: @error-color;
    background: fade(@error-color, 10);
  }
  .ant-tag-success {
    color: @success-color;
    background: fade(@success-color, 10);
  }
  .ant-tag-warning {
    color: @warning-color;
    background: fade(@warning-color, 10);
  }
  .ant-card-head-title {
    padding: 10px 0;
    line-height: 32px;
  }
  //Task Details
  .ant-descriptions-item-label {
    color: @color65;
  }
  .ant-descriptions-item-content {
    color: @color85;
  }

  .box {
    background: #fff;
    margin: 0 0 10px;
    padding: 10px 20px;
    border-radius: 5px;
  }

  /** sidebar **/
  .sidebar {
    background: #fff;
    overflow: auto;
    height: calc(100vh - 60px);
  }

  /** form **/
  .ant-form-horizontal .ant-form-item-label {
    font-weight: bold;
    color: @color85;
    > label:not(.ant-form-item-required):before {
      display: inline-block;
      margin-right: 4px;
      font-size: 14px;
      font-family: SimSun, sans-serif;
      line-height: 1;
      content: '*';
      opacity: 0;
    }
  }
  .ant-radio-button-wrapper,
  .ant-form-item-control-input-content {
    color: rgba(0, 0, 0, 0.45);
  }
  .ant-form-item-label > label .ant-form-item-tooltip {
    color: rgba(0, 0, 0, 0.25);
  }

  //radio color styles
  .ant-radio-checked .ant-radio-inner {
    border: 1px solid @link-color;
  }
  .ant-radio-inner::after {
    background-color: @link-color;
  }

  // table
  td.ant-table-column-sort {
    background: none;
  }

  .ant-card {
    .box-radius();
    &.noShadow {
      box-shadow: 0px 0px 0px rgb(255 255 255);
    }
  }
  .ant-tabs-tab-active {
    font-weight: bold;
  }
}

// public component: breadcrumb
.breadcrumb {
  height: 50px;
  line-height: 50px;
  // background: @white;
  margin: 0 -20px 0;
  padding: 0 20px;
  // .box-shadow();
  .breadcrumbContent {
    line-height: 50px;
  }
}

// public box shadow radius
.ant-card,
.actions,
.list {
  .box-shadow();
  .box-radius();
}
.ant-card {
  .list {
    .box-shadow(0 0 0 ,rgba(0, 0, 0, 0%));
  }
}

// public action bar
.actions {
  background: @white;
  padding: @gap20;
  margin-bottom: @gap10;
  width: 100%;
}

// tag
.extraTag {
  background-color: @primary-color;
  color: @white;
  border-radius: 20px;
  font-size: 12px;
  display: inline-block;
  padding: 2px 10px;
  margin-left: 10px;
  line-height: 1.5715;
  &.example {
    background-color: @primary-color;
  }
  &.seg {
    background-color: @btn-primary-bg;
  }
  &.det {
    background-color: rgb(242, 99, 123);
  }
  &.ins {
    background-color: #e8b900;
  }
}

// public list
.list {
  background-color: @white;
  .ant-list-item,
  .ant-list-items .ant-list-item:last-child {
    padding: @gap10 @gap20;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: @gap10 0;
    .box-radius();
    &:hover {
      border-color: @primary-color;
      .box-shadow(0 0 0 2px, rgba(54, 203, 203, 35%));
      cursor: pointer;
    }
    &.failure {
      border-color: @font-red;
    }
    &.sample {
      border-color: @primary-color;
      background-color: fade(@primary-color, 5);
    }
  }
  .ant-list-item-meta-title {
    font-size: @font-size18;
  }
  .title {
    .nameExtra {
      background-color: @primary-color;
      color: @white;
      border-radius: 20px;
      font-size: 12px;
      display: inline-block;
      padding: 2px 10px;
    }
    .titleItem {
      font-size: @font-size14;
      font-weight: normal;
      margin-left: @gap20;
    }
  }
  .titleLabel,
  .bottomContent {
    display: inline-block;
    margin-right: @gap8;
    color: @color45;
  }
  .titleLabel {
    color: @color45;
  }
  .emphasis {
    color: @font-yellow;
  }
  .bottomLabel {
    color: @color65;
  }
  .content {
    padding-top: @gap5;
    text-align: center;
    .contentLabel {
      color: @color45;
      padding-bottom: @gap5;
    }
    .contentContent,
    .sets {
      color: @color85;
      font-size: @font-size20;
    }
    .sets {
      color: @primary-color;
      display: flex;
      justify-content: center;

      span {
        display: inline-block;
        overflow: hidden;
      }
      .setLabel {
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
        padding: 0 @gap5;
        &:first-child {
          color: @font-bule;
        }
      }
    }
    .currentIteration {
      color: @font-red;
    }
  }
}

// public dataset and model group
.groupList {
  .groupTitle {
    line-height: 56px;
    border-bottom: 1px solid #eee;
    padding: 0 20px;
  }
  .foldBtn,
  .groupName {
    font-size: 14px;
    font-weight: bold;
    color: @link-color;
  }
  .groupName {
    margin-right: 10px;
  }
  .groupTable {
    margin: 10px 20px;
  }
}

.oddRow {
  background-color: rgb(242, 250, 250);
}

// public Detail card
.ant-card-body,
.datasetDetail,
.taskDetail,
.error {
  .infoTable {
    margin-bottom: 20px;
    .ant-descriptions-view {
      border: none;
    }
    tr,
    th,
    td {
      border: none;
    }
    &.vertical th {
      border-right: 1px solid #fff;
    }
    tr {
      margin-bottom: 1px;
      border-bottom: 1px solid #fff;
    }
  }
}
.datasetDetail,
.taskDetail,
.error {
  .title {
    line-height: 18px;
    font-size: 16px;
    font-weight: bold;
    &::before {
      content: ' ';
      display: inline-block;
      width: 6px;
      height: 18px;
      background-color: #36cbcb;
      vertical-align: bottom;
      margin-right: 10px;
    }
  }
}

// public panel title
.panel {
  .header {
    margin-bottom: 10px;
    padding: 0 16px;
    height: 50px;
    line-height: 50px;
    background-color: #fafafa;
    color: rgba(0, 0, 0, 0.85);
    cursor: pointer;
    &.nobg {
      background: none;
    }
    &:before {
      content: ' ';
      display: inline-block;
      margin-right: 10px;
      margin-top: 18px;
      height: 16px;
      width: 6px;
      background-color: @primary-color;
    }
    .title {
      font-size: 16px;
      font-weight: bold;
    }
    .foldBtn {
      color: @btn-primary-bg;
    }
  }
}

// public pager
.ant-pagination.pager {
  margin: 16px 0;
  text-align: right;
}

// search input
.search {
  .ant-form-item-label {
    font-weight: normal;
    text-align: left;
  }
  .ant-form-item {
    margin-bottom: 10px;
  }
  .ant-input-suffix {
    color: rgba(0, 0, 0, 45%);
  }
}
// icon text
.ant-btn,
.ant-space-item {
  .anticon + span {
    margin-left: 5px;
  }
}

// right side form
.rightForm {
  position: relative;
  .mask {
    position: absolute;
    width: calc(100% + 20px);
    height: calc(100% + 10px);
    display: flex;
    align-items: end;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 5;
    margin: 0 -10px -10px;
  }
}

.fullTab {
  .ant-card-body {
    padding: 20px;
  }
  .ant-card-head {
    padding: 0;
  }
  .ant-tabs-nav-list {
    flex: 1;
  }
  .ant-tabs-large > .ant-tabs-nav .ant-tabs-tab {
    padding: 16px 20px;
    flex: 1;
    justify-content: center;
  }
  .ant-tabs > .ant-tabs-nav .ant-tabs-nav-operations {
    display: none;
  }
}
